package com.excetop.xservlet.req.param;

/**
 * float 参数
 * @author xuZW
 *
 */
public class FloatParam extends TextParam {

	/**
	 * float 参数值
	 */
	private float floatValue;
	
	/**
	 * float 参数值数组
	 */
	private float[] floatValueArray;
	
	public FloatParam() {
	}
	
	public FloatParam(String name, String[] textValueArray) {
		this(name, textValueArray, null);
	}
	
	public FloatParam(String name, String[] textValueArray, String[] patternArray) {
		super(name, textValueArray, patternArray);
		setType(TYPE_FLOAT);
		String[] values = getTextValueArrayWithoutSpaceCharacter();
		if(null != values && values.length > 0){
			floatValueArray = new float[values.length];
			for (int i = 0; i < floatValueArray.length; i++) {
				try { floatValueArray[i] = Float.valueOf(values[i]); }
				catch (Exception e) {}
			}
		}
		String value = getTextValueWithoutSpaceCharacter();
		if(null != value){
			try { floatValue = Float.valueOf(value); }
			catch (Exception e) {}
		}
	}
	
	public float getFloatValue() {
		return floatValue;
	}

	public void setFloatValue(float floatValue) {
		this.floatValue = floatValue;
	}

	public float[] getFloatValueArray() {
		return floatValueArray;
	}

	public void setFloatValueArray(float[] floatValueArray) {
		this.floatValueArray = floatValueArray;
	}

	@Override
	public boolean verifying() {
		boolean result = true;
		// TODO Auto-generated method stub
		return result;
	}
	
}
